#include "scene.h"

Scene::Scene(string Name)
{
	this->m_bActive = false;
	this->m_stName = Name;
	this->m_stActiveHud = "";
}

Scene::~Scene()
{
}

string Scene::getName()
{
	return this->m_stName;
}

void Scene::keyboardInput(GLubyte key, GLint x, GLint y)
{
	switch (key)
	{
	default:
		break;
	}

	for(int i = 0; i < this->m_HUDList.Length(); i++)
		if(this->m_HUDList[i]->Active())
			this->m_HUDList[i]->keyboardInput(key, x, y);
}

void Scene::Draw()
{
	for(int i = 0; i < this->m_HUDList.Length(); i++)
		if(this->m_HUDList[i]->Active())
			this->m_HUDList[i]->Draw();
}

void Scene::AddHud(HUD* newHud, string Name)
{
	this->m_HUDList.Add(newHud, Name);
}

void Scene::ActivateHud(string Name)
{
	if(this->m_stActiveHud != "")
		DeactivateHud(this->m_stActiveHud);

	this->m_HUDList[Name]->Activate();

	this->m_stActiveHud = Name;
}

void Scene::DeactivateHud(string Name)
{
	try
	{
		this->m_HUDList[Name]->Deactivate();
	}
	catch(...){}
}


void Scene::Activate()
{
	this->m_bActive = true;
}

void Scene::Deactivate()
{
	this->m_bActive = false;
}

bool Scene::Active()
{
	return this->m_bActive;
}